# -*- coding: utf-8 -*-
# @Time : 2025/1/25 15:14
# @Author : debbyszhang
# @File : add_sub_chainmaker.py
# @desc :
import time

import allure
from playwright.sync_api import expect

from pageObject.relay_list_page import RelayListPage


@allure.feature("网关搜索")
class TestSearch:

    def test_search(self, page):
        relay_page = RelayListPage(page)
        relay_page.search_gateway('aaaa')
        content = relay_page.page.locator('table > tbody > tr > td > span > span').text_content()
        assert content == '暂无数据'

        relay_page.search_gateway('relay')
        gateway_list_data = relay_page.get_gateway_list()
        print(len(gateway_list_data))
        assert len(gateway_list_data) > 0



# # 测试数据
# test_data = [
#     {"username": "user1", "password": "pass1"},
#     {"username": "user2", "password": "pass2"}
# ]
#
# class TestLogin:
#     @pytest.mark.parametrize("data", test_data)
#     def test_login(self, data):
#         username = data["username"]
#         password = data["password"]
#         # 模拟登录逻辑
#         assert login(username, password) == True


